<extend name="Public:common"/>
<block name="css">
    <link rel="stylesheet" href="__STATIC__/layui/css/layui.css"  media="all">
    <style>
        .newMess th{text-align:center;}
        th,td{padding: 10px;}
        .table thead>tr>th, .table tbody>tr>th, .table tfoot>tr>th, .table thead>tr>td, .table tbody>tr>td, .table tfoot>tr>td{vertical-align: middle}
    </style>
</block>
<block name="content">
    <div class="page-header"><h1><i class="fa fa-home"></i> 首页>商家管理>添加单品供应商</h1></div>
    <div class="container-fluid">
        <form action="" method="post">
            <input type="hidden" name="supplier_id" value="{$supplier_id}">
            <table class="table table-striped table-bordered table-hover table-condensed text-center">
                <tbody>
                <tr>
                    <td style="width:25%;"><b> <span class="required">*</span>供应商名称</b></td>
                    <td class="text-left">
                        <input type="text" name="supplier_name" placeholder="供应商名称" value="{$supplierInfo.supplier_name}" required />
                    </td>
                </tr>
                <tr>
                    <td style="width:25%;"><b> <span class="required">*</span>供应商类型</b></td>
                    <td class="text-left">
                        <select name="type" id="" required="required">
                            <option <if condition="$supplierInfo['type'] eq 1">selected</if> value="1">交通供应商</option>
                            <option <if condition="$supplierInfo['type'] eq 2">selected</if> value="2">酒店供应商</option>
                            <option <if condition="$supplierInfo['type'] eq 3">selected</if> value="3">保险供应商</option>
                            <option <if condition="$supplierInfo['type'] eq 4">selected</if> value="4">景区供应商</option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td style="width:25%;"><b> <span class="required">*</span>使用币种</b></td>
                    <td class="text-left">
                        <select name="currency_id" id="" required="required">
                            <volist name="currency" id="vo">
                                <if condition="is_numeric($key)">
                                    <option value="{$key}" <if condition="$supplierInfo['currency_id'] eq $key">selected</if> >{$vo}</option>
                                </if>
                            </volist>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td><b> <span class="required">*</span>联系人</b></td>
                    <td class="text-left">
                        <input type="text" name="Linkman" placeholder="请输入联系人" value="{$supplierInfo.Linkman}" required />
                    </td>
                </tr>
                <tr>
                    <td><b> <span class="required">*</span>联系电话</b></td>
                    <td class="text-left">
                        <input type="text" name="Linkman_phone" placeholder="联系电话"  maxlength="11" value="{$supplierInfo.Linkman_phone}" required />
                    </td>
                </tr>
                <tr>
                    <td><b> <span class="required">*</span>编号</b></td>
                    <td class="text-left">
                        <input type="text" name="supplier_sn" readonly placeholder="编号" value="{$shopSn}" required />
                    </td>
                </tr>
                <tr>
                    <td><b> <span class="required">*</span>合作时间</b></td>
                    <td class="text-left">
                        <input type="text" id="start_time" name="start_time" readonly placeholder="合作开始时间" value="{$supplierInfo.start_time|default=$toDay}" required />
                        至
                        <input type="text" id="end_time" name="end_time" readonly placeholder="合作结束时间" value="{$supplierInfo.end_time}" required />
                    </td>
                </tr>
                <tr>
                    <td style="width:25%;"><b> <span class="required">*</span>所在地</b></td>
                    <td class="text-left">
                        国家
                        <select name="country" id="ar_country_id"  onchange="getProvince(this,'ar')" required>
                            <option value="">==选择国家==</option>
                            <volist name="country" id="vo">
                                <option <if condition="$supplierInfo['country'] eq $vo['areaId']">selected</if>  value="{$vo.areaId}">{$vo.areaName}</option>
                            </volist>
                        </select>
                        省
                        <select name="province" id="ar_province_id"  onchange="getCity(this,'ar')" required>
                            <option value="">==选择省==</option>
                            <volist name="province" id="vo">
                                <option <if condition="$supplierInfo['province'] eq $vo['areaId']">selected</if>  value="{$vo.areaId}">{$vo.areaName}</option>
                            </volist>
                        </select>
                        市
                        <select name="city" id="ar_city_id"  onchange="getArea(this,'ar')" required>
                            <option value="">==选择市==</option>
                            <volist name="city" id="vo">
                                <option <if condition="$supplierInfo['city'] eq $vo['areaId']">selected</if> value="{$vo.areaId}">{$vo.areaName}</option>
                            </volist>
                        </select>
                        区
                        <select name="area"   id="ar_area_id"  required>
                            <option value="">==选择区==</option>
                            <volist name="area" id="vo">
                                <option <if condition="$supplierInfo['area'] eq $vo['areaId']">selected</if>   value="{$vo.areaId}">{$vo.areaName}</option>
                            </volist>
                        </select>

                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        <if condition="checkAuth('Operator/Shops/addShops')">
                            <input type="submit" class="btn btn-primary" value="保存">
                        </if>
                    </td>
                </tr>
                </tbody>
            </table>
        </form>
    </div>
</block>
<block name="js">
    <script src="__STATIC__/layui/layui.all.js"></script>
    <script src="__STATIC__/layui/layui.js"></script>
    <script>
        layui.use('laydate', function() {
            var laydate = layui.laydate;
            //常规用法
            laydate.render({
                elem: '#start_time'
            });
            laydate.render({
                elem: '#end_time'
            });
        });

    </script>
</block>